<!doctype html>
<title>Enter key</title>

<script>

window.addEventListener("keydown", keydownHandler, false);
	
function keydownHandler(event)
{
  if(event.keyCode === 13)
  {
    console.log("Enter key pressed");
  }
}
	
</script>